home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / processes / pthreadsorts / sorts / bubblesortpicture.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-10-06  |  1.6 KB  |  51 lines

  1. /*
  2.     File:        BubbleSortPicture.h
  3.  
  4.     Contains:    BubbleSort Classes O(N*N)
  5.  
  6.     Written by:     Karl Groethe
  7.  
  8.     Copyright:    Copyright © 2000 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.             You may incorporate this Apple sample source code into your program(s) without
  11.             restriction. This Apple sample source code has been provided "AS IS" and the
  12.             responsibility for its operation is yours. You are not permitted to redistribute
  13.             this Apple sample source code as "Apple sample source code" after having made
  14.             changes. If you're going to re-distribute the source, we require that you make
  15.             it clear in the source that the code was descended from Apple sample source
  16.             code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                         7/00    Created
  20. */
  21. #ifndef BUBBLE_SORT_PICTURE
  22. #define BUBBLE_SORT_PICTURE
  23.  
  24. #include "SortablePicture.h"
  25.  
  26. class BubbleSortPicture : public SortablePicture
  27. {
  28.     public:
  29.         BubbleSortPicture(ResID pictID) : SortablePicture(pictID){}
  30.         virtual CFStringRef GetSortName(){return CFSTR("BubbleSort");}
  31.         virtual void Sort();
  32.         
  33. };
  34. //Bubble Sort, only reversed
  35. class RBubbleSortPicture : public SortablePicture
  36. {
  37.     public:
  38.         RBubbleSortPicture(ResID pictID) : SortablePicture(pictID){}
  39.         virtual CFStringRef GetSortName(){return CFSTR("BubbleSort(reversed)");}
  40.         virtual void Sort();
  41. };
  42. //Bubble Sort, alternating directions
  43. class BiDirBubbleSortPicture : public SortablePicture
  44. {
  45.     public:
  46.         BiDirBubbleSortPicture(ResID pictID) : SortablePicture(pictID){}
  47.         virtual CFStringRef GetSortName(){return CFSTR("Bi-Directional Bubble Sort");}
  48.         virtual void Sort();
  49. };
  50.  
  51. #endif